<?php
class Compute
{
    private $mem; //内存
    private $cpu; //CPU
    public  $display; //显示器

    public function __construct($mem,$cpu,$display)
    {
        $this->mem = $mem;
        $this->cpu = $cpu;
        $this->display = $display;
        $this->show();
    }

    //显示配配置
    public function show()
    {
        header("Content-type:text/html;charset=utf-8");
        echo "内存:" . $this->mem . "<br>";
        echo "CPU:" .  $this->cpu . "<br>";
        echo "内存:" . $this->display . "<br>";
        echo "<hr>";
    }

    //看电影
    public function play($name)
    {
        echo "<hr>你正在看这部电影:" . $name;
    }
}


$compute1 = new Compute('1G','i3 2.4G', 'TCL');
$compute2 = new Compute('2G','i5 3G','AOC');


$compute1->play('让子弹飞');
$compute2->play('我不是药神');